// 本地测试地址
// let bUrl = "http://shuaiwx.bluej.cn:3333/api/";
// 正式地址
let bUrl = "http://christmasgift.bluej.cn/api/"; 
// let bUrl = "http://localhost:3105/api/";
let urls = {
    joinActive: bUrl +"joinActive",
    getAllUser: bUrl + "getAllUser",
    getTarget: bUrl +"getTarget"
}

function myReq(url,data={},method="get",sucCb=()=>{},errorCb=()=>{},completeCb=()=>{}){
    data = data || {};
    method = method || "get";
    $.ajax({
        url:url,
        method,
        data:data,
        success:function(res){
            if(res.res!=0){
                typeof sucCb=="function" && sucCb(res)
            }else{
                layer.alert(res.msg,{icon: 2});   
            }
        },
        error:function(e){
            console.log(e);
            layer.alert('网络请求错误!', {icon: 2});
        },
        complete: function(e) {
            completeCb()
        }
    })
}